package com.mender.api.client;

import com.mender.common.result.Result;
import com.mender.domain.po.AddressBook;
import com.mender.domain.po.User;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.Map;

@FeignClient(name = "user-service")
public interface UserClient {

//    根据id查询地址
    @GetMapping("/user/addressBook/{id}")
    Result<AddressBook> getAddressBookById(@PathVariable Long id);


    /**
     * 根据id获取用户信息
     * @param id
     * @return
     */
    @PostMapping("/user/user/getById")
    Result<User> getUserById(Long id);

    /**
     * 新增用户数
     */
    @PostMapping("/user/user/countNewUser")
    Result<Integer> countNewUserByMap(@RequestBody Map<String, Object> params);
}
